// pages/register.js
Page({
  data: {
    "nickname":[],
    "password":[],
    "hidden":true
  },
  onValidate(){
    var nickname=this.data.nickname
    var password=this.data.password
    var isValidate =this.validate(nickname,password)
    console.log(isValidate)
    if(isValidate){
      wx.navigateTo({
        url: '../validate/validate?nickname='+nickname+'&&password='+password
      })
    }
  },
  validate(nickname,password){
    if(nickname!=null&&nickname!=''&&password!=null&&password!=''){
      return true
    }
    this.setData({
      isValidate:false,
      hidden:false
    })
    return false
  }
})